package model

import "gorm.io/gorm"

type Video struct {
	gorm.Model
	Title               string `gorm:"type:varchar(50);not null;index;comment:'视频标题'"`
	Desc                string `gorm:"type:varchar(100);not null;index;comment:'视频描述'"`
	CoverUrl            string `gorm:"type:varchar(100);not null;index;comment:'视频封面'"`
	UserId              uint   `gorm:"type:int;not null;index;comment:'上传用户id'"`
	Status              int    `gorm:"type:tinyint;not null;index;default:0;comment:'状态：0-连载 1-完结'"`
	Type                int    `gorm:"type:tinyint;not null;index;default:0;comment:'类型：0-普通视频 1-剧集视频'"`
	VideoCategoryId     int    `gorm:"type:int;not null;index;default:0;comment:'视频分类id'"`
	ChannelId           int    `gorm:"type:int;not null;index;default:0;comment:'视频频道id'"`
	EpisodeCount        int    `gorm:"type:int;not null;index;default:0;comment:'剧集数量'"`
	UpdatedEpisodeCount int    `gorm:"type:int;not null;index;default:0;comment:'连载的剧集数量'"`
	PlayCount           int    `gorm:"type:int;not null;default:0;comment:'播放数量'"`
	LikeCount           int    `gorm:"type:int;not null;default:0;comment:'点赞数量'"`
	CommentCount        int    `gorm:"type:int;not null;default:0;comment:'评论数量'"`
	CollectCount        int    `gorm:"type:int;not null;default:0;comment:'收藏数量'"`
}

type VideoEpisode struct {
	gorm.Model
	VideoId      int    `gorm:"type:int;not null;index;comment:'视频id'"`
	Title        string `gorm:"type:varchar(50);not null;index;comment:'剧集标题'"`
	Desc         string `gorm:"type:varchar(100);not null;index;comment:'剧集描述'"`
	CoverUrl     string `gorm:"type:varchar(100);not null;index;comment:'剧集封面'"`
	Episode      int    `gorm:"type:int;not null;default:0;comment:'剧集'"`
	IsFree       int    `gorm:"type:tinyint;not null;index;default:0;comment:'是否免费：0-免费 1-付费'"`
	PlayCount    int    `gorm:"type:int;not null;default:0;comment:'播放数量'"`
	LikeCount    int    `gorm:"type:int;not null;default:0;comment:'点赞数量'"`
	CommentCount int    `gorm:"type:int;not null;default:0;comment:'评论数量'"`
	CollectCount int    `gorm:"type:int;not null;default:0;comment:'收藏数量'"`
}
